package com.jiunuan.live.im.router.provider.cluster;

import org.apache.dubbo.rpc.Invoker;
import org.apache.dubbo.rpc.RpcException;
import org.apache.dubbo.rpc.cluster.Cluster;
import org.apache.dubbo.rpc.cluster.Directory;

/**
 * @Author: JiuNuan
 * @CreateTime: 2024-08-16 13:47
 * @Description: 基于cluster的spi扩展，实现根据rpc上下文选择具体请求的机器
 */

public class ImRouterCluster implements Cluster{
    @Override
    public <T> Invoker<T> join(Directory<T> directory, boolean buildFilterChain) throws RpcException {
        return new ImRouterClusterInvoker<>(directory);
    }
}
